<?php

class ZFKiller_Form_Element_Cep extends ZFKiller_Form_Element_Text {

	public function __construct($spec, $options = null) {
		ZFKiller_Form_Element::formatDefaultOptions($spec, $options);

		if (!isset($options['label'])) {
			$options['label'] = 'Cep';
		}

		parent::__construct($spec, $options);

		$this
				->addFilter('Digits')
				->setMaxlength(9)
				->addValidators(array(
					'NotEmpty',
					array('stringLength', false, array(8, 8)),
				))
		;

		ZFKiller_Form_Element::addAttrib($this, 'class', 'cep');
	}

}